/*
 * @描述:
 * @作者: 约訂
 * @Date: 2024-10-14 15:11:09
 * @LastEditTime: 2024-11-18 09:37:16
 * @修改人员: 约訂
 */
import { createApp } from "vue";
import App from "./App.vue";

// import "~/styles/element/index.scss";

// import ElementPlus from "element-plus";
// import all element css, uncommented next line
// import "element-plus/dist/index.css";

// or use cdn, uncomment cdn link in `index.html`

import "~/styles/index.scss";
import "uno.css";
import router from "./router";
import store from "./store";
import ElementPlus from "element-plus";
import { ElMessage } from "element-plus";
import "element-plus/dist/index.css";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import bus from "@/utils/bus";
// If you want to use ElMessage, import it.
import "element-plus/theme-chalk/src/message.scss";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import VueContextMenu from "vue-contextmenu";
import rightClick from "./utils/rightClick";
import { Post } from "./api/module/http";
import "./styles/element/css-vars.css";

const app = createApp(App);
const ShowMessage = function (val: object): void {
  ElMessage.closeAll();
  ElMessage(val);
};
// app.use(ElementPlus);
app.use(ElementPlus, {
  locale: zhCn,
});
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
/**请求挂载全局 */
app.config.globalProperties.$Post = Post;
app.directive("right-click", rightClick);
app.config.globalProperties.$bus = bus;
app.use(store);
app.use(router);
app.use(VueContextMenu);
/**消息挂载 */
app.config.globalProperties.$ShowMsg = ShowMessage;
app.mount("#app");
